home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 16728 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.4 KB

  1. Path: news.cs.ucla.edu!not-for-mail
  2. From: jlz@pelican.cs.ucla.edu (Jian Zhen)
  3. Newsgroups: comp.lang.c,comp.lang.c++
  4. Subject: help with a simple c routine
  5. Followup-To: poster
  6. Date: 11 Apr 1996 13:34:38 -0700
  7. Organization: UCLA CS Dept
  8. Message-ID: <4kjqcu$794@pelican.cs.ucla.edu>
  9. References: <4kin72$ns5@pelican.cs.ucla.edu>
  10. NNTP-Posting-Host: pelican.cs.ucla.edu
  11.  
  12. Hi all
  13.  
  14. I am trying to write a simple c routine that gets rid of all the .. or . 
  15. in dir paths like somehting/../..  or somedir/./something type
  16.  
  17. so let's say I ahve the follwoing paths
  18.  
  19. /home/jlz/../jlz
  20.  
  21. after parsing it I should have
  22.  
  23. /home/jlz
  24.  
  25. or
  26.  
  27. /home/./jlz
  28.  
  29. it becomes
  30.  
  31. /home/jlz
  32.  
  33. I can't think of an easy way of doing this.  Please help!
  34.  
  35. thanks very much
  36.  
  37. email me if possible.
  38.  
  39. Jian
  40.  
  41.  
  42.  
  43. -- 
  44. +---------------------------------------------------------------------------+
  45. | Jian Liang Zhen | Home         : 1.310.915.5135 | 3325 S. Sepulveda BLVD. |
  46. | jlz@cs.ucla.edu | Lab (BH 3811): 1.310.825.0360 | Apt 6.  LA. CA. 90034   |
  47. |___________/---------- http://pack.cs.ucla.edu:2909/ ----------\___________|
  48.  
  49.  
  50. -- 
  51. +---------------------------------------------------------------------------+
  52. | Jian Liang Zhen | Home         : 1.310.915.5135 | 3325 S. Sepulveda BLVD. |
  53. | jlz@cs.ucla.edu | Lab (BH 3811): 1.310.825.0360 | Apt 6.  LA. CA. 90034   |
  54. |___________/---------- http://pack.cs.ucla.edu:2909/ ----------\___________|
  55.